home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / drivers1.zip / GETEA.ASM < prev    next >
Assembly Source File  |  1992-01-17  |  548b  |  28 lines

  1. ;put into the public domain by Russell Nelson, nelson@crynwr.com
  2.  
  3. ether_byte    db    ?,?,?,?
  4.  
  5. get_eaddr:
  6. ;enter with ds:si -> Ethernet address to parse, es:di -> place to put it.
  7.     mov    cx,EADDR_LEN
  8. get_eaddr_2:
  9.     push    cx
  10.     push    di
  11.     mov    di,offset ether_byte
  12.     call    get_hex
  13.     mov    al,cl            ;remember the number in al.
  14.     pop    di
  15.     pop    cx
  16.     jc    get_eaddr_3        ;exit if no number at all.
  17.     stosb                ;store a byte.
  18.     cmp    byte ptr [si],':'    ;skip colons between bytes.
  19.     jne    get_eaddr_4
  20.     inc    si
  21. get_eaddr_4:
  22.     loop    get_eaddr_2
  23.     clc
  24. get_eaddr_3:
  25.     ret
  26.  
  27.  
  28.